﻿using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
//using static DataModel.ExternalInstructionIn;

namespace DataModel
{
    public class GlobalVar
    {
        public static ConcurrentDictionary<int, TempratureModel> tempCache = new ConcurrentDictionary<int, TempratureModel>();
        public static bool connectioinCache = false;
        public static bool disableCache = false;
        public static string ConnectionString;
        /// <summary>
        /// 感温电缆连接状态
        /// </summary>
        public static bool TEMP_CONN_STATE = false;
        
        //public static DateTime HeadingBQUpdateTime = DateTime.Now;
                                                      //public static DateTime HeadingBDUpdateTime = DateTime.Now;
                                                      //public static ConcurrentDictionary<string, GPS> keyValueGPS = new ConcurrentDictionary<string, GPS>();
                                                      //public static ConcurrentDictionary<string, GPS> keyValueGPSBP = new ConcurrentDictionary<string, GPS>();
                                                      //public static ConcurrentDictionary<string, short[]> CalculatedCarPostion = new ConcurrentDictionary<string, short[]>();
                                                      //public static ConcurrentDictionary<string, double> PitchCom = new ConcurrentDictionary<string, double>();
                                                      //public static ConcurrentDictionary<string, float[]> vsf = new ConcurrentDictionary<string, float[]>();
                                                      //public static ConcurrentDictionary<string, GPS> k_id_v_gps = new ConcurrentDictionary<string, GPS>();
                                                      //public static ConcurrentDictionary<string, GPS> k_id_v_gpsBP = new ConcurrentDictionary<string, GPS>();
                                                      ///// <summary>
                                                      ///// 刮平回转范围（回转，俯仰）
                                                      ///// </summary>
                                                      //public static ConcurrentDictionary<string, List<Point>> bqangel = new ConcurrentDictionary<string, List<Point>>();
                                                      ///// <summary>
                                                      ///// 切入点计算
                                                      ///// </summary>
                                                      //public static ConcurrentQueue<List<(double, int, int, int, double)>> cutPoint = new ConcurrentQueue<List<(double, int, int, int, double)>>();
                                                      ///// <summary>
                                                      ///// 自动化取料作业切入点数据库记录
                                                      ///// </summary>
                                                      //public static List<(int, int)> cutPostion = new List<(int, int)>();
                                                      ///// <summary>
                                                      ///// 取料终止点（x，y，z）
                                                      ///// </summary>
                                                      //public static ConcurrentDictionary<string, List<(int, int)>> endSignal = new ConcurrentDictionary<string, List<(int, int)>>();
                                                      //public static ConcurrentQueue<List<(int, int, int, int)>> pitchAl = new ConcurrentQueue<List<(int, int, int, int)>>();
                                                      ///// <summary>
                                                      ///// 自动作业刮平切入点sql
                                                      ///// </summary>
                                                      //public static ConcurrentQueue<string> Point = new ConcurrentQueue<string>();
                                                      ///// <summary>
                                                      ///// 作业范围所有的俯仰值
                                                      ///// </summary>
                                                      //public static ConcurrentQueue<string> allPitch = new ConcurrentQueue<string>();
                                                      ///// <summary>
                                                      ///// 自动作业刮平切入点sql
                                                      ///// </summary>
                                                      //public static ConcurrentQueue<short> PointF = new ConcurrentQueue<short>();
                                                      ///// <summary>
                                                      ///// 自动化点数据处理后
                                                      ///// </summary>
                                                      //public static ConcurrentQueue<List<(int, int, int)>> keyPointList = new ConcurrentQueue<List<(int, int, int)>>();
                                                      //public static ConcurrentQueue<Point> leftDataQueue = new ConcurrentQueue<Point>();
                                                      //public static ConcurrentQueue<Point> rightDataQueue = new ConcurrentQueue<Point>();
                                                      //public static ConcurrentQueue<Point> thirdDataQueue = new ConcurrentQueue<Point>();
                                                      ///// <summary>
                                                      ///// 安全俯仰sql语句处理后
                                                      ///// </summary>
                                                      //public static ConcurrentQueue<double[]> SafePi = new ConcurrentQueue<double[]>();
                                                      //public static ConcurrentDictionary<string, List<Box>> k_id_v_box = new ConcurrentDictionary<string, List<Box>>();
                                                      ///// <summary>
                                                      ///// 从PLC读取的数据
                                                      ///// </summary>
                                                      //public static ConcurrentQueue<short[]> ReadPLCMess = new ConcurrentQueue<short[]>();
                                                      ///// <summary>
                                                      ///// 边界信息
                                                      ///// </summary>
                                                      //public static ConcurrentQueue<short[]> BoundaryQueue = new ConcurrentQueue<short[]>();
                                                      ///// <summary>
                                                      ///// 自动话取料的时候起始点结束点信息
                                                      ///// </summary>
                                                      //public static ConcurrentQueue<short[]> AutoWorkPoints = new ConcurrentQueue<short[]>();
                                                      ///// <summary>
                                                      ///// 自动取料后开始后大车的实时信息
                                                      ///// </summary>
                                                      //public static ConcurrentQueue<short[]> AutoBoundaryMonitor = new ConcurrentQueue<short[]>();
                                                      ///// <summary>
                                                      ///// 南料厂的sql语句
                                                      ///// </summary>
                                                      //public static ConcurrentQueue<string> southSql = new ConcurrentQueue<string>();
                                                      ///// <summary>
                                                      ///// 刮平作业时回转范围
                                                      ///// </summary>
                                                      //public static ConcurrentQueue<short[]> HeaArea = new ConcurrentQueue<short[]>();
                                                      ///// <summary>
                                                      ///// 取料作业时回转范围
                                                      ///// </summary>
                                                      //public static ConcurrentQueue<short[]> qlHeaArea = new ConcurrentQueue<short[]>();
                                                      ///// <summary>
                                                      ///// 北料厂的sql语句
                                                      ///// </summary>
                                                      //public static ConcurrentQueue<string> northSql = new ConcurrentQueue<string>();
                                                      ///// <summary>
                                                      ///// 换成删除料斗以上的点Sql
                                                      ///// </summary>
                                                      ////public static ConcurrentQueue<string> deletePointsou = new ConcurrentQueue<string>();
                                                      ////public static ConcurrentQueue<string> deletePointnor = new ConcurrentQueue<string>();
                                                      ///// <summary>
                                                      ///// 数据库查找到的点
                                                      ///// </summary>
                                                      //public static ConcurrentDictionary<string, List<(int, int, int)>> keyPiontList = new ConcurrentDictionary<string, List<(int, int, int)>>();
                                                      ///// <summary>
                                                      ///// 内外角范围
                                                      ///// </summary>
                                                      //public static ConcurrentQueue<List<short>> InnerOuterAngleQueue = new ConcurrentQueue<List<short>>();
                                                      ///// <summary>
                                                      ///// 自动化作业信号等
                                                      ///// </summary>
                                                      //public static ConcurrentDictionary<string, short[]> AutoBQpoint = new ConcurrentDictionary<string, short[]>();
                                                      ///// <summary>
                                                      ///// 自动化留边换边信号
                                                      ///// </summary>
                                                      //public static ConcurrentDictionary<string, short[]> ChangePos = new ConcurrentDictionary<string, short[]>();
                                                      ///// <summary>
                                                      ///// plc的工作状态
                                                      ///// </summary>
                                                      //public static ConcurrentQueue<WorkState> workStates = new ConcurrentQueue<WorkState>();
                                                      ///// <summary>
                                                      ///// 防止碰撞队列
                                                      ///// </summary>
                                                      //public static ConcurrentQueue<short[]> CollisionList = new ConcurrentQueue<short[]>();
                                                      ///// <summary>
                                                      ///// 图片路径
                                                      ///// </summary>
                                                      //public static ConcurrentQueue<List<string>> PicturePaths = new ConcurrentQueue<List<string>>();
                                                      ///// <summary>
                                                      ///// 取料X的范围
                                                      ///// </summary>
                                                      //public static ConcurrentQueue<List<int>> stackAndEndX = new ConcurrentQueue<List<int>>();
                                                      ///// <summary>
                                                      ///// 取料作业切入点回转、俯仰//回转角度/俯仰角
                                                      ///// </summary>
                                                      //public static ConcurrentQueue<short[]> WorkSta = new ConcurrentQueue<short[]>();
                                                      ///// <summary>
                                                      ///// 刮平回转范围sql语句
                                                      ///// </summary>
                                                      //public static ConcurrentQueue<string> HeaSQL = new ConcurrentQueue<string>();

        ///// <summary>
        ///// 取料结束为止sql语句
        ///// </summary>
        //public static ConcurrentQueue<string> EndSQL = new ConcurrentQueue<string>();
        ///// <summary>
        ///// 判断取料运行方向左边界
        ///// </summary>
        //public static ConcurrentQueue<string> WayLeft = new ConcurrentQueue<string>();
        ///// <summary>
        ///// 判断取料运行方向右边界
        ///// </summary>
        //public static ConcurrentQueue<string> WayRight = new ConcurrentQueue<string>();
        ///// <summary>
        ///// 取料是否留边判断
        ///// </summary>
        //public static ConcurrentQueue<string> Left = new ConcurrentQueue<string>();
        //public static ConcurrentQueue<string> Center = new ConcurrentQueue<string>();
        //public static ConcurrentQueue<string> Right = new ConcurrentQueue<string>();
        ///// <summary>
        ///// 安全俯仰角sql
        ///// </summary>
        //public static ConcurrentQueue<string> SafePitch = new ConcurrentQueue<string>();

        ///// <summary>
        /////  PLC给出的判断取料切入点的信息((1)正在取料1，取料完成2，（2）)
        ///// </summary>
        //public static ConcurrentDictionary<string, short[]> plcMess = new ConcurrentDictionary<string, short[]>();

        ///// <summary>
        ///// 俯仰角度
        ///// </summary>
        //public static double Pitch = 80;
        ///// <summary>
        ///// 获取当前回取料转角度
        ///// </summary>
        //public static double HeadingBQ
        //{
        //    get {
        //        if (WCS_BQ_ISVALID)
        //        {
        //            return Heading_BQ_3D;
        //        }
        //        else
        //        {
        //            return Heading_BQ_PLC;
        //        }
        //    }
        //}
        //public static double Heading_BQ_3D = 0;
        //public static double Heading_BQ_PLC = 0;
        ///// <summary>
        ///// 获取当前堆料回转角度
        ///// </summary>
        //public static double HeadingBD
        //{
        //    get
        //    {
        //        if (WCS_BD_ISVALID)
        //        {
        //            return Heading_BD_3D;
        //        }
        //        else
        //        {
        //            return Heading_BD_PLC;
        //        }
        //    }
        //}
        //public static double Heading_BD_3D = 0;
        //public static double Heading_BD_PLC = 0;
        ///// <summary>
        ///// 数采计算是否刮平
        ///// </summary>
        //public static short Signal = 4;
        //public static double left = 50;
        //public static double right = 50;
        //public static double center = 50;
        //public static short safePit = 50;
        ////public static short HeaDir = 2;
        ///// <summary>
        ///// PLC给出的是否刮平1刮平，2未刮平
        ///// </summary>
        //public static short signal = 4;
        //public static short sig = 4;
        ///// <summary>
        ///// 取料运行方向 1左转 2右转
        ///// </summary>
        //public static short dir = 4;
        ///// <summary>
        ///// 一键盘煤
        ///// </summary>
        //public static short AutoStictiec = 0;
        ///// <summary>
        ///// 累计取煤量
        ///// </summary>
        //public static int coal9A = 0;
        //public static int coal9B = 0;

        //public static ConcurrentQueue<string> uwbSqlS = new ConcurrentQueue<string>();
        ///// <summary>
        ///// 扫描仪时间
        ///// </summary>
        //public static DateTime RLSTime = DateTime.MinValue;
        ///// <summary>
        ///// 设备运行状态
        ///// </summary>
        //public static int equipState = 0;
        ///// <summary>
        ///// PLC连接状态
        ///// </summary>
        //public static bool PLC_CONN_STATE = false;
        //public static int STACK_PIDAI_STATE = 0;
        //public static int TAKE_GUABANR_STATE = 0;

        ///// <summary>
        ///// 可燃气体报警器连接状态
        ///// </summary>
        //public static bool GAS_CONN_STATE { get; set; }


        ///// <summary>
        ///// WCS是否可用
        ///// </summary>
        //public static bool WCS_BD_ISVALID;
        //public static bool WCS_BQ_ISVALID;
        ///// <summary>
        ///// 积灰报警位
        ///// </summary>
        //public static bool WCS_BD_DirtyBit_Alarm;
        //public static bool WCS_BQ_DirtyBit_Alarm;
        //public static double pitchCenterHeight;
        //public static double pitchCenterToCenter;
    }
}
